/**************************************
 *
 * VLOOK 模板主题
 *
 * powered by MAX°孟兆
 *
 * QQ Group: 805502564
 * Telegram Channel: t.me/vlook_markdown
 * email: maxchow@qq.com
 *
 * For(wechat): MaxChow
 * 2023-3
 *
 *************************************/

@import "../font";
@import "../color";
@import "../common";

@vQuery: "ws=off";

// 主题信息
@themeVer: "V25.0";
@themeName: "vlook-x-dic";
@themeDesc: "× DIC";
@themeEmail: "maxchow@qq.com";

// 指定字体主题
// .applyFontStyle(win);
// .applyFontStyle(serif);
.applyFontStyle(local);
// 文档背景使用图片
.applyDocBgImg(@docBgImgLight_Twill_R, @docBgImgDark_Twill_R);
// 指定主题配套的圆角
// .applyThemeRadius(big);
.applyThemeRadius(leaf);

:root {
    --thm-email: "maxchow@qq.com";
    --thm-fav-logo-lg: url("");
    --thm-fav-logo-dk: var(--thm-fav-logo-lg);
}

// 主题主色
@theme1: #009FE9;//#00A0E6;
@theme2: #D71517;//#E60012;
@theme3: #FFFFFF;
@theme1Dark: #00A7F5;//darken(@theme1, 20%);
@theme1Alt: #CCEFFF;//lighten(@theme1, 15%);
@theme1AltDark: #004666;//darken(@theme1, 35%);//@codeBgColorDark;
@theme2Dark: #DF1618;//darken(@theme2, 20%);
@theme2Alt: #FADCDD;//lighten(@theme2, 20%);//lighten(@theme2, 50%);
@theme2AltDark: #5D090A;//darken(@theme2, 35%);//darken(@theme2Alt, 75%);
@theme1Fade: rgba(red(@theme1), green(@theme1), blue(@theme1), @accOpacity);
@theme2Fade: rgba(red(@theme2), green(@theme2), blue(@theme2), @accOpacity);
@theme2FadeDark: rgba(red(@theme2), green(@theme2), blue(@theme2), 40%);

// 标题色
@headerColor: @theme1;
@headerColorDark: @theme1Dark;
// 渐变标题色 h1-h5
@lgH1Bg: linear-gradient(90deg, @theme1 25%, #2060E0);
@lgH2Bg: @lgH1Bg;
@lgH3Bg: @lgH1Bg;
@lgH4Bg: @lgH1Bg;
@lgH5Bg: @lgH1Bg;
@lgH1BgClip: text;
@lgH2BgClip: @lgH1BgClip;
@lgH3BgClip: @lgH1BgClip;
@lgH4BgClip: @lgH1BgClip;
@lgH5BgClip: @lgH1BgClip;
@lgH1Color: transparent;
@lgH2Color: @lgH1Color;
@lgH3Color: @lgH1Color;
@lgH4Color: @lgH1Color;
@lgH5Color: @lgH1Color;

// 自定义章节自动编号
// 导出的 HTML 中不生效，须添加以下 VLOOK 的调校参数「vlook-chp-autonum」
@vChpAutoNum: "h1{{第 ### 章 }}";
@h1BeforeContent: "第" counter(h1) "章 ";
@h6BeforeContent: "▰ "; // ■ ▱▰ ⏥▰▱

// @tocHeaderNumColor: @docTextColorLightFade;
@contentHeaderNumOpacity: .5;
@contentHeaderNumColor: @theme1;
@headerBackground: none;//linear-gradient(0deg, var(--h-bg-start), var(--h-bg-end));
@multiHeaderBG: none;
@headerTextAlign: center;
@headerPadding: 10px 0 0 0;
//@headerLetterSpacing: 0;//0.15em;
@h1Margin: 2em 0 0 0;
@h2Margin: 2em 0 0 0;
@h3Margin: 1.5em 0 0 0;
@h4Margin: 1.5em 0 0 0;
@h5Margin: 1.25em 0 0 0;
@h6Margin: 1em 0 0 0;

@headerTextAlign: left;

// 题注文字、背景色
// @captionTextColor: var(--d-fc-a);
@captionBackground: none;

// 行内代码
@codeTextColor: @theme2;

// 按钮色
@buttonForeColor: @theme3;
@buttonForeHoverColor: @theme3;
@buttonBgColor: @theme1;
// 文库按钮颜色
@docLibButtonForeColor: @buttonForeColor;
@docLibButtonForeHoverColor: @buttonForeHoverColor;
@docLibButtonBgColor: @buttonBgColor;
// 指定 kbd 按钮风格
.applyKbdRadius(leaf);

// 链接颜色
@aBorderWidth: 2px;
@aColor: @headerColor;
@aColorDark: @headerColorDark;
@aLineColor: @theme2;
@aHoverColor: @aLineColor;
@aActiveColor: desaturate(@aLineColor, 50%);

// 表格边框
@tableBorderColor: var(--d-fc-a);
@tableBorderWidth: 0;
@tableBorderLeftWidth: 0;
@tableBorderRightWidth: 0;
@tableBorderTopWidth: 0;
@tableBorderBottomWidth: 2px;
@tableThBorderRightWidth: 1px solid var(--d-bc);
// 表格行 hover
@tableTrHoverBg: fade(@aHoverColor, 20%);
@tableTrHoverBgDark: fade(@aHoverColor, 25%);
// 表格背景
@tableBackground: var(--d-bc);
@tableThColor: var(--d-bc);
@tableThBackground: @tableBorderColor;
@tableTdBackground: none;
// 表格单元格阴影
@tableFirstThBoxShadow: none;
@tableThBoxShadow: 0 1px 0 var(--tbl-h-bd) inset;
@tableThRepeaterBoxShadow: @tableThBoxShadow;
@tableFirstTdBoxShadow: none;
@tableTdBoxShadow: 0 -1px 0 0 var(--tbl-cell-bd);

// 封面、封底文字位置及对齐方式
@coverTextAlign: left;
@coverTextPadding: 110px 80px 50px;
@coverTextColor: @theme3;
@coverSubColor: @theme1Alt;
@coverUnderlineColor: @coverSubColor;
@coverAuthorColor: @coverUnderlineColor;
@coverOwnerColor: @coverAuthorColor;

@backCoverTextAlign: right;
@backCoverTextPadding: 80px 80px 50px 80px;
@backCoverTextColor: @theme3;

// 封面装饰性文本样式 before
@coverTextBeforeContent: "";
@coverTextBeforePosition: initial;
@coverTextBeforeLeft: initial;
@coverTextBeforeTop: initial;
@coverTextBeforeColor: initial;
@coverTextBeforeFontSize: initial;
@coverTextBeforeFontWeight: initial;
@coverTextBeforeOpacity: initial;
// 封面装饰性文本样式 after
@coverTextAfterContent: "";
@coverTextAfterTextAlign: initial;
@coverTextAfterLeft: initial;
@coverTextAfterTop: @coverTextBeforeTop;
@coverTextAfterRight: initial;
@coverTextAfterColor: @coverTextBeforeColor;
@coverTextAfterFontSize: @coverTextBeforeFontSize;

// 封面、封底标题的文字阴影样式
@coverTextShadow: 3px 3px 4px rgba(0, 0, 0, .25);
@backCoverTextShadow: -3px 3px 4px rgba(0, 0, 0, .25);

// 对比度边框色，用于主题色与背景色对比度比较低时的边缘视觉识别
// @contrastBorder: 0 0 0 1px rgba(0, 0, 0, .2);
@contrastBorder: 0 0 0 0 transparent;
@contrastBorderForCover: 0 0 0 2px fade(@theme1, 20%) inset;

// 封面背景设置
@coverBackgroundColor: @theme1;
@coverBackgroundImage: var(--thm-logo), var(--thm-c-bg-e), var(--thm-c-right-bg), var(--thm-c-tree), var(--thm-c-bg-lg);
@coverBackgroundSize: auto, auto, 230px 250px, auto, auto;
@coverBackgroundRepeat: no-repeat, repeat-x, no-repeat, no-repeat, no-repeat;
@coverBackgroundPosition: 80px 820px, right bottom, right bottom 200px, right top, left top;

// 封底背景设置
@backCoverBackgroundColor: @coverBackgroundColor;
@backCoverBackgroundImage: var(--thm-logo), var(--thm-bc-bg-e), var(--thm-bc-left-bg), var(--thm-bc-tree), var(--thm-bc-bg-lg);
@backCoverBackgroundSize: auto, auto, 230px 190px, auto, auto;;
@backCoverBackgroundRepeat: @coverBackgroundRepeat;
@backCoverBackgroundPosition: right 80px top 450px, left bottom, left bottom 140px, left top, right top;

// 文档扩展区域背景
// @docExtBackgroundColor: var(--d-bc);
@docExtBackgroundImage: var(--thm-doc-ext-bg), var(--thm-doc-ext-logo);
@docExtBackgroundSize: auto, auto;
@docExtBackgroundRepeat: no-repeat, repeat;
@docExtBackgroundPosition: left top, left bottom;

// 封面、封底素材资源
:root {
    --thm-c-tree: url("");
    --thm-c-bg-e: url("");
    --thm-c-right-bg: url("");
    --thm-logo: url("");
    --thm-c-bg-lg: linear-gradient(135deg, @theme1 40%, #2060E0);
    // backcover
    --thm-bc-tree: url("");
    --thm-bc-bg-e: url("");
    --thm-bc-left-bg: url("");
    --thm-bc-bg-lg: linear-gradient(200deg, @theme1 40%, #2060E0);
    // doc-ext-bg
    --thm-doc-ext-logo: url("");
}

@import "../base";

// 标题 after 样式
#write :is(h1,h2,h3,h4,h5)>span::after {
    content: "";
    background: @theme1;
    opacity: .3;
    width: .625em;
    height: .625em;
    border-radius: .25em 0;
    margin: 5px;
    position: relative;
    display: inline-flex;
    vertical-align: top;
}

// 封底 span::after 选择器
@backcoverSpanAfter: ~"@{coverAfterYAML}~@{backcoverId}>span::after";
@backcoverSpanWithoutYAMLafter: ~"@{coverWithoutYAML}~@{backcoverId}>span::after";
@{backcoverSpanAfter},
@{backcoverSpanWithoutYAMLafter} {
    content: "" !important;
    background: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    position: absolute !important;
}

// 生成指定风格的徽章样式
.genBadgeStyle(dyn);

// 生成 GSA 样式
.genGSA_simple();
